Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: move copy_in_test to pkg/sql/copy to have all copy tests together #96232

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

cucaroach
Copy link
Contributor

Epic: CRDB-18892
Informs: #91831
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@cucaroach cucaroach marked this pull request as ready for review January 31, 2023 03:55
@cucaroach cucaroach requested review from otan, a team and DrewKimball January 31, 2023 03:55
@@ -8,7 +8,7 @@
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package sql_test
package copy_test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can just be package copy now right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, IDK, what's the motivation? Is the idea to use _test only when its necessary to break a package dep cycle? I thought _test was good hygiene for the only test/use the public bits perspective (which I don't really buy but not the hill I want to die on). Curious your thoughts...

Copy link
Contributor

@otan otan Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_test only when its necessary to break a package dep cycle

that was my understanding. that and it has caused me headaches in the past when doing build work :P but not important here.

I thought _test was good hygiene for the only test/use the public bits perspective

eh, usually for tests you want to do unit tests which involve private methods right...


either way, not a hill i'm looking to die on either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna go with if you remove _test and everything still works then it shouldn't be there as a good principle here. Thanks!

@@ -140,3 +142,13 @@ func ArrayStringToSlice(t *testing.T, array string, message ...string) []string
}
return strings.Split(array[1:length-1], ",")
}

// PgxConn is a helper to create a pgx.Conn from a url.
func PgxConn(t *testing.T, connURL url.URL) (*pgx.Conn, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: PGXConn is the best practice form

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cucaroach
Copy link
Contributor Author

TFTRs!
bors r+

@craig
Copy link
Contributor

craig bot commented Jan 31, 2023

Build succeeded:

@craig craig bot merged commit e402d82 into cockroachdb:master Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants